Shape Checking of Array Programs
نویسندگان
چکیده
Shape theory provides a framework for the study of data types in which shape and data can be manipulated separately. This paper is concerned with shape checking, i.e. the detection of shape errors, such as array bound errors, without handling the data. It can be seen as a form of partial evaluation in which data computations are ignored. We construct a simply-typed lambda-calculus that supports a vector type constructor, whose iteration yields types of arrays. It is expressive enough to construct all of the usual array operations. All shape errors in a term t can be detected by evaluating its shape #t which proceeds by rst eliminating all the data, and then evaluating in the usual way. Evaluation of #t will terminate if that of t does.
منابع مشابه
QUBE - Array programming with dependent types
Array programming languages such as APL or MATLAB use multidimensional arrays as the primary data structures. Rank-generic operations apply transparently to vectors, matrices, and arrays with an even higher rank. Often, these operations require that the ranks, shapes, and the elements of their arguments satisfy certain constraints. For example, in MATLAB, the element-wise addition A + B dynamic...
متن کاملTurning Dynamic Typing into Static Typing by Program Specialization
Array processing languages such as APL, Matlab and Octave rely on dynamic typechecking by the interpreter rather than static typechecking and are designed for user convenience with a syntax close to mathematical notation. Functions and operators are highly overloaded. The price to be paid for this flexibility is computational performance, since the run-time system is responsible for type checki...
متن کاملSymbolic Execution with Abstract Subsumption Checking
We address the problem of error detection for programs that take recursive data structures and arrays as input. Previously we proposed a combination of symbolic execution and model checking for the analysis of such programs: we put a bound on the size of the program inputs and/or the search depth of the model checker to limit the search state space. Here we look beyond bounded model checking an...
متن کاملTurning Dynamic Typing into Static Typing by Program Specialization in a Compiler Front-end for Octave
Array processing languages such as APL, Matlab and Octave rely on dynamic typechecking by the interpreter rather than static typechecking and are designed for user convenience with a syntax close to mathematical notation. Functions and operators are highly overloaded. The price to be paid for this flexibility is computational performance, since the run-time system is responsible for type checki...
متن کاملA Shape System and Loop Invariant Inference
Pointer programs remain a major challenge for program analysis and verification. Shape analysis can discover the shape invariants of data structures in the heap and detect errors about manipulating pointers in a program. This paper presents a shape analysis for linked list programs based on a new shape graph representation. Our shape graphs could describe unbounded data structures without loss ...
متن کامل